package cloudgamesaumysql

import (
	"gorm.io/gorm"
	"time"
)

/*
  @author liubogeng
  @date   2024/8/28 14:29
*/

// CGGameAUFrontLog 云游戏AU供前端日志表
type CGGameAUFrontLog struct {
	ID            int64          `json:"id" gorm:"column:id;type:bigint;primaryKey;autoIncrement;comment:ID"`
	UserID        int64          `json:"user_id" gorm:"column:user_id;type:bigint;not null;default:0;comment:用户ID"`
	RequestMethod string         `json:"request_method" gorm:"column:request_method;type:varchar(64);not null;default:'';comment:请求方式"`
	RemoteAddr    string         `json:"remote_addr" gorm:"column:remote_addr;type:varchar(500);not null;default:'';comment:客户端的IP地址"`
	Host          string         `json:"host" gorm:"column:host;type:varchar(500);not null;default:'';comment:目标服务器的主机名或IP地址"`
	RequestURI    string         `json:"request_uri" gorm:"column:request_uri;type:varchar(500);not null;default:'';comment:请求资源路径"`
	RequestBody   string         `json:"request_body" gorm:"column:request_body;type:text;comment:请求体"`
	ResponseBody  string         `json:"response_body" gorm:"column:response_body;type:text;comment:响应体"`
	ResponseCode  int64          `json:"response_code" gorm:"column:response_code;type:bigint;not null;default:0;comment:响应状态码"`
	CreatedAt     time.Time      `json:"created_at" gorm:"column:created_at;type:datetime;comment:该条记录创建时间"`
	UpdatedAt     time.Time      `json:"updated_at" gorm:"column:updated_at;type:datetime;comment:该条记录修改时间"`
	DeletedAt     gorm.DeletedAt `json:"-" gorm:"index;type:datetime;comment:该条记录删除时间"`
}

func (CGGameAUFrontLog) TableName() string {
	return "z_cg_game_au_front_log_2025_07"
}
